﻿extends layout

block content
	script(src='/javascripts/jquery-1.7.1.js')
	script(src='/socket.io/socket.io.js')
	script
		$(document).ready(function(){
			var socket = io.connect();
			socket.emit('join',["#{name}"]);
			socket.on('message', function(data){
				var output='<li><h3>'+data.sender+'</h3> : <p>'+data.textdata+'</p></li>';
				$(output).prependTo('#chatcontent');
			});
			$('#send').click(function(){
				socket.emit('message',{sender:'#{username}',textdata: $('#typechat').val()});
			});
		});
		
	p Welcome to #{name} , #{username} 님
	a(href='/quitgame') 게임 나가기
	table
		for color in ['red', 'yellow', 'blue', 'black']
			tr
				for i in [1,2,3,4,5,6,7,8,9,10,11,12,13]
					td(width=52,height=100,bgcolor="green",align="center",valign="top")
						font(size=32,color="#{color}") #{i}
	div#deck(style="position:absolute;top:500;left:0;width:800;height:200;background-color:#aaaaaa")
	div(style="position:absolute;top:720;left:0;width:800;height:200;background-color:#777777;overflow:scroll")
		ul#chatcontent
	div(style="position:absolute;top:920;left:0;width:800;height:20;background-color:#ffffff")
		input#typechat(type='text')
		input#send(type='submit', value='전송')